
/* ###############################################

		1. 작    성   일 	>> 	2007. 1. 29
	
		2. 파    일   명 	>> 	Client.h

 		3. 내          용 	>> 	Client Entity Class...( IpAddress, Client )
 		
 		4. 작   성    자 	>>	최철호
 		
 		5. 최종수정일	>>	2007. 1. 29
										
################################################ */

#ifndef _CLIENT_H
#define _CLIENT_H

#include "PSocket.h"
#include <string>

using namespace std;

class Client
{
public :
	Client( string ipAddress = "" );
	Client( string ipAddress, PSocket* clientConnectSocket );
	Client( const Client& source );
	virtual ~Client();
	
	Client& operator =( const Client& source );
	bool operator==( const Client& other );
	bool operator!=( const Client& other );

	string& GetIpAddress() const;
	PSocket* GetClientConnectSocket() const;

	// 위임함수...
	int GetSocket() const;
	SockAddrIn GetSocketAddress() const;

private :
	string ipAddress;				// ipAddress
	PSocket* clientConnectSocket;	// 클라이언트와 연결할 소켓...
};

inline string& Client::GetIpAddress() const
{
	return const_cast<string&>( this->ipAddress );
}

inline PSocket* Client::GetClientConnectSocket() const
{
	return const_cast<PSocket*>( this->clientConnectSocket );
}

inline int Client::GetSocket() const
{
	return this->clientConnectSocket->GetSocket();
}

inline SockAddrIn Client::GetSocketAddress() const
{
	return this->clientConnectSocket->GetSocketAddress();
}

#endif // _CLIENT_H
